<!DOCTYPE html>
<html lang="zh-CN">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">

<title>welcome Flowing software</title>
<!-- Bootstrap core CSS -->
<link href="./static/css/bootstrap.min.css" rel="stylesheet">

<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="./static/css/ie10-viewport-bug-workaround.css"
	rel="stylesheet">

<!-- Custom styles for this template -->
<link href="./static/css/dashboard.css" rel="stylesheet">

<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="./static/js/ie-emulation-modes-warning.js"></script>


<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<script src="./static/js/jquery.min.js"></script>
<script src="./static/js/fw4websocket.js"></script>
<script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
<script type="application/javascript">
	    function init(option,id){
			var chartDom = document.getElementById(id);
			var myChart = echarts.init(chartDom);
			option && myChart.setOption(option);

		}
		function show(a) {
          var str = '类别:';
          return str.concat(
            a.name + '\n\n' + '次数:',
            a.value + '\n\n' + '占比:',
            ((a.value / 2010) * 100).toFixed(2) + '%'
          );
        }
		function s(){
				parent.ws.send('run', "Hello Run");
                parent.ws.message(function(evt) {
                    var data = JSON.parse(evt.data);
					console.log(data);
					data.data.tooltip.formatter = show;
					data.data.series[0].label.formatter = show;
					init(data.data,"container");
                });
				setTimeout(s, 5000);
		}
        $(document).ready(function() {
			s();
        });

    
</script>
</head>

<body style="padding: 0 0 0 0">
	<div>
		<div id="console-container">
			<div id="main" class="panel panel-default" style="width:300px">
				<div id="container" style="height: 300px"></div>
			</div>
		</div>
	</div>

	<!-- Bootstrap core JavaScript
    ================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->
	<script src="./static/js/jquery.min.js"></script>
	<script src="./static/js/bootstrap.min.js"></script>
	<!-- Just to make our placeholder images work. Don't actually copy the next line! -->
	<script src="./static/js/holder.min.js"></script>
	<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
	<script src="./static/js/ie10-viewport-bug-workaround.js"></script>
	<script src="./static/js/template-native.js"></script>
	<script id="template" type="text/html">

    </script>
</body>

</html>
